package uk.ac.ebi.uniprot.wikipedia.NotCore;


import com.hp.hpl.jena.rdf.model.Model;
import virtuoso.jena.driver.VirtModel;

import java.io.File;
import java.io.FileInputStream;

/**
 * Created by IntelliJ IDEA.
 * User: ljgarcia
 * Date: 08/03/12
 * Time: 10:06
 * To change this template use File | Settings | File Templates.
 */
public class TryMe {
    public static void main(String[] args) {
        String conn_str = "jdbc:virtuoso://199.102.237.69:1111/charset=UTF-8/log_enable=2";
        //String conn_str = "jdbc:virtuoso://virtuoso.idiginfo.org:1111/charset=UTF-8/log_enable=2";

        //VirtGraph graph = new VirtGraph ("Example3", "jdbc:virtuoso://localhost:1111", "dba", "dba");
        //File rdf = new File("C:\\temp\\test\\cpath2_main.owl");
        File rdf = new File("C:\\temp\\test\\genewiki-latest.rdf");

        //String graph = "http://biotea.ws/rdf/pathway/";
        String graph = "http://biotea.ws/rdf/genewiki/";
        try {
            System.out.println("==Uploading== - " + rdf.getName());
            Model md = VirtModel.openDatabaseModel(graph, conn_str, "dba", "ld2rdf@virtu.oso");
            //Model md = VirtModel.openDatabaseModel(graph, conn_str, "leylajg", "Log23In!");
            md.read(new FileInputStream(rdf), graph);
            System.out.println("==Uploaded== - " + rdf.getName());
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("An error has occurred while uploading the RDF (" + rdf.getName() + "): " + e.getMessage());
        }
    }
}
